package com.thinkTank.oa.common;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/***
 * 
 * 按web.xml配置顺序应该是先加载ContextLoaderListener，此时spring会自动去调用SpringContextHolder的setApplicationContext方法。随后调用AListener
但是移植到spring boot之后，通过@ServletComponentScan，或者在入口函数下面通过@Bean向spring注册bean，都会先加载AListener后在SpringContextHolder中设置上下文
 * @author dq
 *
 */
@WebListener
public class InitContextListener   implements ServletContextListener{

	public void contextDestroyed(ServletContextEvent arg0) {
		arg0.getServletContext().log("thinkTank oa development Destroyed");
	}
	
	public void contextInitialized(ServletContextEvent arg0) {
		arg0.getServletContext().log("thinkTank oa development start.");
		
		SystemGlobals.getInstance().initializing(arg0.getServletContext());
	}

}
